home *** CD-ROM | disk | FTP | other *** search
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Screen;
- import javax.microedition.lcdui.TextBox;
-
- class ColldemoSl45$TextEntry extends TextBox implements CommandListener {
- public static final int VALID = 0;
- public static final int INVALID = 1;
- private Display display;
- private Displayable nextDisp;
- private Command okCommand;
- // $FF: renamed from: Id int
- private int field_0;
- private ColldemoSl45$Game game;
- // $FF: synthetic field
- private final ColldemoSl45 this$0;
-
- public ColldemoSl45$TextEntry(ColldemoSl45 var1, Display var2, Displayable var3, ColldemoSl45$Game var4) {
- super("test", "", 8, 0);
- this.this$0 = var1;
- this.okCommand = new Command("OK", 4, 1);
- this.field_0 = 0;
- this.game = var4;
- this.display = var2;
- this.nextDisp = var3;
- ((Displayable)this).addCommand(this.okCommand);
- ((TextBox)this).setConstraints(0);
- ((Screen)this).setTitle("Hi-score");
- }
-
- public void showMe() {
- ((Displayable)this).setCommandListener(this);
- this.display.setCurrent(this);
- }
-
- public void commandAction(Command var1, Displayable var2) {
- String var4 = ((TextBox)this).getString();
- int var3;
- if (this.field_0 != -1) {
- var3 = this.game.validateAction(var1.getCommandType(), this.field_0, var4);
- } else {
- var3 = 0;
- }
-
- if (var3 == 0) {
- this.display.setCurrent(this.nextDisp);
- } else {
- ((TextBox)this).setString("");
- }
-
- }
- }
-